<style scoped>
</style>
<template>
    <div class="mui-content books-list-content" id="content">

        微信授权页面

    </div>
</template>
<script>

    import api from '@/fetch/api';
    import axios from 'axios'
    let wx = process.env.WX_CONFIG;


    export default {
        data () {
            return {
                subjects: {},
            }
        },
        methods: {},
        mounted(){
            let $this = this;
            location.href=`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wx.appId}&redirect_uri=${wx.redirect_outh}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`

            console.log(wx);
//      let params = {
//        'grant_type': 'client_credential',
//        'appid': process.env.WX_CONFIG.appId,
//        'secret': process.env.WX_CONFIG.secret
//      };
//      let url = 'https://api.weixin.qq.com/cgi-bin/token';
//      console.log(JSON.stringify(params));
//      return new Promise((resolve, reject) => {
//        axios({
//          method: 'post',
//          url: url,
//          params: params
//        }).then((response) => {
//          console.log(JSON.stringify(response));
//          //resolve(response.data);
//        })
//      });

        }
    }

</script>
